#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;
using Microsoft.Reporting.WebForms;

#endregion

namespace PLACEHR.Web.Categories.Business.Forms
{
    public partial class PrintVacationForm : Form
    {
        public EmployeeVacation currItem;
        public PrintVacationForm()
        {
            InitializeComponent();
            InitializeData();
        }

        private void InitializeData()
        {

        }

        private void SalaryDetail_Load(object sender, EventArgs e)
        {
        }

        private void rpvSalaryDetails_HostedPageLoadComplete(object sender, Gizmox.WebGUI.Forms.Hosts.AspPageEventArgs e)
        {
            if (currItem != null)
            {

                rpvSalaryDetails.ProcessingMode = ProcessingMode.Remote;
                rpvSalaryDetails.ServerReport.ReportServerUrl = new Uri(string.Format("http://localhost/ReportServer"));
                rpvSalaryDetails.ServerReport.ReportPath = string.Format("/PlaceHR.Report/VacationApprovedReport");

                ReportParameterInfoCollection c = rpvSalaryDetails.ServerReport.GetParameters();
                if (c.Any(o => o.Name == "EmployeeVacationID" && o.Visible == false))
                {
                    return;
                }
                else
                {
                    var reportParams = new ReportParameter();
                    reportParams.Name = "EmployeeVacationID";
                    reportParams.Visible = false;
                    reportParams.Values.Add(currItem.EmployeeVacationId.ToString());

                    rpvSalaryDetails.ServerReport.SetParameters(reportParams);
                }
            }
        }

    }
}